﻿using System;
using System.Collections.Generic;
using System.Web;

/// <summary>
/// Summary description for ClassifiedAd
/// </summary>
public class ClassifiedAd
{
    //public ClassifiedAd(long id, long categoryID, string title, string adText, DateTime expiryTime, DateTime postDate, byte priceType, double price, bool searching, byte textFormat,
    //    double latitude, double longitude, string contactPhone, string contactEMail, string contactUrl, Attribute[] attributes, byte comments, byte status, string statusDescription)
    //{
    //    ID = id;
    //    CategoryID = categoryID;
    //    Title = title;
    //    AdText = adText;
    //    ExpiryTime = expiryTime;
    //    PostDate = postDate;
    //    Price = price;
    //    Searching = searching;
    //    ContactPhone = contactPhone;
    //    ContactEMail = contactEMail;
    //    ContactUrl = contactUrl;
    //    Longitude = longitude;
    //    Latitude = latitude;
    //    TextFormat = textFormat;
    //    Attributes = attributes;
    //    PriceType = priceType;
    //    Comments = comments;
    //}

    public ClassifiedAd(long id, long categoryID, string title, string adText, DateTime expiryTime, DateTime postDate, byte priceType, double price, bool searching, byte textFormat,
        double latitude, double longitude, string contactPhone, string contactEMail, string contactUrl, Attribute[] attributes, byte status, string statusDescription, long userID)
    {
        ID = id;
        CategoryID = categoryID;
        Title = title;
        AdText = adText;
        ExpiryTime = expiryTime;
        PostTime = postDate;
        Price = price;
        Searching = searching;
        ContactPhone = contactPhone;
        ContactEMail = contactEMail;
        ContactUrl = contactUrl;
        Longitude = longitude;
        Latitude = latitude;
        TextFormat = textFormat;
        Attributes = attributes;
        PriceType = priceType;
        Status = status;
        StatusDescription = statusDescription;
        UserID = userID;
    }

    public ClassifiedAd(long id, long categoryID, string title, string text)
    {
        ID = id;
        CategoryID = categoryID;
        Title = title;
        AdText = text;
    }

    public ClassifiedAd(long id, long categoryID, string title, DateTime postTime)
    {
        ID = id;
        CategoryID = categoryID;
        Title = title;
        PostTime = postTime;
    }

    public ClassifiedAd(Attribute[] attributes)
    {
         Attributes = attributes;
    }

    public void SetAnonExpDays(short days)
    {
        ExpAnonDays = days;
    }

    public void SetNonAnonExpDays(short days)
    {
        ExpNonAnonDays = days;
    }

    public void SetComments(byte comments)
    {
        Comments = comments;
    }

    public void SetApprove(bool approve)
    {
        NeedToApprove = approve;
    }

    public void SetAllowRenewal(bool allow)
    {
        AllowRenewal = allow;
    }

    public void SetCurrencyCode(string currCode)
    {
        CurrencyCode = currCode;
    }

	public long ID { get; private set; }

	public long CategoryID { get; private set; }

	public string Title { get; private set; }

	public string AdText { get; private set; }

	public DateTime ExpiryTime { get; private set; }

    public DateTime PostTime { get; private set; }

    public bool Searching { get; private set; }

    public byte TextFormat { get; private set; }

	public double Price { get; private set; }

    public double Latitude { get; private set; }

    public double Longitude { get; private set; }

	public string ContactPhone { get; private set; }

	public string ContactEMail { get; private set; }

	public string ContactUrl { get; private set; }

    public Attribute[] Attributes { get; private set; }

    public short ExpAnonDays { get; private set; }

    public short ExpNonAnonDays { get; private set; }

    public bool AllowRenewal { get; private set; }

    public byte PriceType { get; private set; }

    public byte Comments { get; private set; }

    public byte Status { get; private set; }

    public string StatusDescription { get; private set; }

    public bool NeedToApprove { get; private set; }

    public string CurrencyCode { get; private set; }

    public long UserID { get; private set; }
}